package com.recruit.wechat.controller;


import com.recruit.wechat.controller.model.ApiResultModel;
import org.springframework.web.bind.annotation.RequestMapping;
import com.recruit.wechat.bean.result.ResultPage;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ResponseBody;

import com.recruit.wechat.bean.WechatJobApplication;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author LF
 * @since 2020-08-25
 */
@Controller
@RequestMapping("/WeChatUser/wechatJobApplication")
public class WechatJobApplicationController extends BaseController{
     /** 主页面 */
    @RequestMapping("admin/main.html")
    public String main(){
       return  "wechatJobApplication/WechatjobapplicationMain";
    }
    /** 添加页面跳转
     * @return 返回页面
     */
    @RequestMapping(value = "admin/addWechatJobApplicationHtml")
    public String addWechatJobApplicationHtml( ){
             return "wechatJobApplication/WechatjobapplicationAdd";
    }
    /** 编辑页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "admin/editWechatJobApplicationHtml")
    public String editWechatJobApplicationHtml(Integer id ,Model model ){
           model.addAttribute("wechatJobApplication",wechatJobApplicationService.selectWechatJobApplicationByIdWechatJobApplication(id));
             return "wechatJobApplication/WechatjobapplicationEdit";
    }

    /** 查看页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "admin/showWechatJobApplicationHtml")
    public String showWechatJobApplicationHtml(Integer id ,Model model ){
           model.addAttribute("wechatJobApplication",wechatJobApplicationService.selectWechatJobApplicationByIdWechatJobApplication(id));
             return "wechatJobApplication/WechatjobapplicationShow";
    }


    /** 分页查询WechatJobApplication
     * @param page  页码
     * @param limit  查几条
     * @param wechatJobApplication  前端传进的参数
     * @return 返回统一分页信息
     */
    @RequestMapping(value = "admin/findWechatJobApplicationByPage")
    @ResponseBody
    public ResultPage findWechatJobApplicationByPage(Integer page, Integer limit,WechatJobApplication wechatJobApplication){
             return wechatJobApplicationService.findWechatJobApplicationByPage(page,limit,wechatJobApplication);
    }

    /** 添加WechatJobApplication
     * @param wechatJobApplication  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "admin/addWechatJobApplication")
    @ResponseBody
    public ApiResultModel saveWechatJobApplication(WechatJobApplication wechatJobApplication  ){
             return wechatJobApplicationService.addWechatJobApplication(wechatJobApplication);
    }

    /** 编辑WechatJobApplication
     * @param wechatJobApplication  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "admin/editWechatJobApplication")
    @ResponseBody
    public ApiResultModel editWechatJobApplication(WechatJobApplication wechatJobApplication  ){
             return wechatJobApplicationService.editWechatJobApplication(wechatJobApplication);
    }



    /** 删除一条WechatJobApplication
     * @param id  前端传进的ID
     * @return 返回统一信息
     */
    @RequestMapping(value = "admin/delWechatJobApplication")
    @ResponseBody
    public ApiResultModel delWechatJobApplication( Integer id  ){
             return wechatJobApplicationService.delWechatJobApplication(id);
    }


}
